package com.fjsaas.flyway;

import java.sql.Connection;

import org.flywaydb.core.api.MigrationInfo;
import org.flywaydb.core.api.callback.BaseFlywayCallback; 

import com.fjsaas.flyway.command.Command;

public class FMCallback extends BaseFlywayCallback {	
	
	private Command command;
	
	public Command getCommand() {
		return command;
	}


	public void setCommand(Command command) {
		this.command = command;
	}

	@Override
	public void beforeEachMigrate(Connection connection, MigrationInfo info) {
		command.execute();
		super.beforeEachMigrate(connection, info);
	}
}
